
<center><div style="height:35px;"><div id="message">&nbsp;</div></div></center>
<?php if($this->Session->read('message')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('message').'");</script>';
	$this->Session->delete('message');	
	}?>
<?php if($this->Session->read('error')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('error').'",1);</script>';
	$this->Session->delete('error');
}?>
	<form id="listForm" name="listForm" method="get" action="#">
    <table class="list">
      <tbody>
      <tr>
       <th align="left"><?php echo $this->Common->columnTitle(_resource('name'))?></th>
       <th align="center" width="50px"><?php echo $this->Common->columnTitle(_resource('move'))?></th>
       <th align="left" width="50px"><?php echo $this->Common->columnTitle(_resource('controller'))?></th>       
       <th align="left" width="50px"><?php echo $this->Common->columnTitle(_resource('method'))?></th>
       <th align="center" width="20px"><?php echo $this->Common->columnTitle(_resource('link'))?></th>
       <th align="left"><?php echo $this->Common->columnTitle(_resource('url'))?></th>                
        <th align="center" width="100px"><?php _resource('task');?></th>
      </tr>
		<?php
			if(count($data0)>0){
			foreach($data0 as $k=>$v){
		?>
      <tr class="row<?php echo fmod($k,2)+1;?>" onmouseout="this.className='row<?php echo fmod($k,2)+1;?>'" onmouseover="this.className='highlight'">
      	<td align="left"><a onclick="ajax('addContent','<?php echo $this->params['controller']?>/edit/<?php echo $v[$uses[0]]['id'];?>');" href="javascript:;" ><?php echo $v[$uses[0]]['name'];?></a> </td>
      	<td align="center">
      		<span title="<?php _resource('up');?>"><a href="javascript:;" onclick="ajax('listContent','<?php echo $this->params['controller']?>/moveUp/<?php echo $v[$uses[0]]['id'];?>');"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/uparrow.png"/></a></span>
			<span title="<?php _resource('down');?>"><a href="javascript:;" onclick="ajax('listContent','<?php echo $this->params['controller']?>/moveDown/<?php echo $v[$uses[0]]['id'];?>');return false;"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/downarrow.png"/></a></span>
		</td>
      	<td align="left" ><?php echo $this->Form->input($uses[0].'.controller.'.$v[$uses[0]]['id'], array('type'=>'select','options'=>$controllerList,'default'=>$v[$uses[0]]['controller'],'empty'=>'',"class"=>"inputbox","label"=>"","error"=>"",'onchange'=>'ajax("methodList'.$v[$uses[0]]['id'].'","'.$this->params['controller'].'/changeMethodList/'.$v[$uses[0]]['id'].'/" + this.value)'));?> </td>
      	<td align="left"><div id="methodList<?php echo $v[$uses[0]]['id']?>"><?php echo $this->Form->input($uses[0].'.method.'.$v[$uses[0]]['id'],array('type'=>'select','options'=>$v[$uses[0]]['methodList'],'default'=>$v[$uses[0]]['method'],'empty'=>'',"class"=>"inputbox","label"=>"","error"=>""));?></div></td>
      	<td align="left"><?php echo $this->Form->checkbox($uses[0].'.isLink.'.$v[$uses[0]]['id'],array('checked'=>$v[$uses[0]]['isLink']?'checked':''));?> </td>
      	<td align="left"><?php echo $this->Form->text($uses[0].'.url.'.$v[$uses[0]]['id'],array('value'=>$v[$uses[0]]['url']));?> </td>
	
        <td align="center">
			<span title="<?php _resource('edit');?>"><a href="javascript:;" onclick="ajax('addContent','<?php echo $this->params['controller']?>/edit/<?php echo $v[$uses[0]]['id'];?>');"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-edit.png"/></a></span>
			<span title="<?php _resource('delete');?>"><a href="javascript:;" onclick="ajaxSubmit('listContent','<?php echo $this->params['controller']?>/delete/<?php echo $v[$uses[0]]['id'];?>','deleteone','',true);return false;"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-trash.png"/></a></span>
		</td>
      </tr>
      <?php } ?>
      <?php } ?>
      
          </tbody>
      </table>
</form>
<script>
	setTimeout("removeMessage()",5000);	
</script>
<div class="pagination">
                <span><?php _resource('display') ?> #
                  <select name="limit" id="limit" class="inputbox" size="1" onchange="ajax('listContent','<?php echo $this->params['controller']?>/display/'+this.value);">
                    <?php 
							for($i=1;$i<10;$i++){
								$v=$i*$webConfig['default_row_per_page'];
								$select=($this->Session->read($uses[0].'.limit')==$v)?'selected="selected"':'';
								echo '<option value="'.$v.'" '.$select.' >'.$v.'</option>';
							}
						?>
                  </select>
                </span>
                <!-- Button prev -->
           
                <?php
                	$paging=$this->Paginator->getPages(); 
							if(isset($paging['prev'])){
								echo $paging['prev'];
							}
							
							
						?>
                <!-- end Button prev -->
                
                    <?php
                    	echo $paging['paging'];
					?>
                  
                <!-- Button next -->
                
                <?php 
							if(isset($paging['next'])){
								echo $paging['next'];
							}
							
						?>
                <!-- end Button next -->
                <span>
                  <?php if(!empty($paging['cboPaging'])){
								echo _resource('goto',true).' # '.$paging['cboPaging'];
							}?>
                </span>
                <span>
                  <?php
								if($paging['totalPage']>0){
								?>
                  Page <?php echo $paging['currentPage']?>/<?php echo $paging['totalPage']?> </span>
                <?php
								}
								?>
                
</div>
